const isImg = (name) => {
  let fileName = name;
  const fileType = fileName.substring(fileName.lastIndexOf('.'));
  return ['.jpg', '.jpeg', '.png'].includes(fileType);
};
export default {
  methods: {
    // 选中文件
    changeFile (file, filelist) {
      this.$set(this.upload.data, 'asImage', isImg(file.name));
      this.ruleForm.fileList = filelist;
    },
    // 移除文件
    removeFile (file, filelist) {
      this.ruleForm.fileList = filelist;
    }
    // // 文件上传成功
    // handleFileSuccess (res) {
    //   console.log('文件上传成功', res);
    //   this.widgetConfig = res
    // },
    // 图片选中文件
    // pictureChangeFile (file, filelist) {
    //   this.ruleForm.pictureFileList = filelist;
    // },
    // 图片移除文件
    // picturRremoveFile (file, filelist) {
    //   this.ruleForm.pictureFileList = filelist;
    // }
    // // 图片文件上传成功
    // picturHhandleFileSuccess (res) {
    //   console.log('图片文件上传成功', res);
    //   this.widgetConfig1 = res
    // }
  }
}
